home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / LhA-Control / Rexx / LhA-Ctrl.Rexx < prev   
OS/2 REXX Batch file  |  1996-07-04  |  18KB  |  524 lines

  1. /*
  2.           Done by Allan 'Duff' Odgaard on Monday 27-Feb-95 22:38:57
  3.           For selective extraction of Lh-Archives in DirectoryOpus.
  4.  
  5. $VER: LhA-Control.Rexx V2.6 (27-Feb-95) Allan 'Duff' Odgaard
  6.                                         <Duff@DK-Online.DK>
  7. */
  8.  
  9. Parse Arg '"' SourceArc '"' PortName .
  10. If PortName ~= '' Then Address(PortName)
  11.  
  12. Busy On
  13.  
  14. Options Results
  15. Options FailAt 21
  16. Query ScreenName
  17. PubScreen = Result
  18. Signal On Syntax
  19.  
  20. BuffersInPref = 10    /* Look in ConfigPart/System/Directories */
  21.  
  22. Shell = 'Con:000/026/640/437/LhA-Selector V2.6 Output/Screen ' || PubScreen
  23.  
  24. If Open('Env','Env:LhA-Control.Paths','R') = 0 Then Do
  25.     Address Command 'C:Which LhA >T:LhA.Path';Open('LhA','T:LhA.Path','R');LhA = ReadLn('LhA');Close('LhA')
  26.     If LhA = '' Then Do;Address Command 'C:RequestFile >T:LhA.Path File "LhA" Title "Where is LhA?" NoIcons PubScreen' PubScreen;Open('LhA','T:LhA.Path','R');LhA = ReadLn('LhA');Close('LhA');End
  27.     Address Command 'C:Which MultiView >T:MultiView.Path';Open('MultiView','T:MultiView.Path','R');MultiView = ReadLn('MultiView');Close('MultiView')
  28.     If MultiView = '' Then Do;Address Command 'C:RequestFile >T:MultiView.Path File "MultiView" Title "Where is MultiView?" NoIcons PubScreen' PubScreen;Open('MultiView','T:MultiView.Path','R');MultiView = ReadLn('MultiView');Close('MultiView');End
  29.     Address Command 'C:Which Rx >T:Rx.Path';Open('Rx','T:Rx.Path','R');Rx = ReadLn('Rx');Close('Rx')
  30.     If Rx = '' Then Do;Address Command 'C:RequestFile >T:Rx.Path File "Rx" Title "Where is Rx?" NoIcons PubScreen' PubScreen;Open('Rx','T:Rx.Path','R');Rx = ReadLn('Rx');Close('Rx');End
  31.  
  32.     SwazFix = ''
  33.     If show('p','SWAZINFO') = 1 Then Do
  34.         Address Command 'C:Which SwazFix >T:SwazFix.Path';Open('SwazFix','T:SwazFix.Path','R');SwazFix = ReadLn('SwazFix');Close('SwazFix')
  35.         If SwazFix = '' Then Do;Address Command 'C:RequestFile >T:SwazFix.Path File "SwazFix" Title "Where is SwazFix?" NoIcons PubScreen' PubScreen;Open('SwazFix','T:SwazFix.Path','R');SwazFix = ReadLn('SwazFix');Close('SwazFix');End
  36.     End
  37.  
  38.     Address Command 'C:Which DIZRespect >T:DIZRespect.Path';Open('DIZRespect','T:DIZRespect.Path','R');DIZRespect = ReadLn('DIZRespect');Close('DIZRespect')
  39.     If DIZRespect = '' Then Do;Address Command 'C:RequestFile >T:DIZRespect.Path File "DIZRespect" Title "Where is DIZRespect?" NoIcons PubScreen' PubScreen;Open('DIZRespect','T:DIZRespect.Path','R');DIZRespect = ReadLn('DIZRespect');Close('DIZRespect');End
  40.  
  41.     If SwazFix = '' Then SwazFix = ';No SwazFix Present'
  42.     If DizRespect = '' Then DizRespect = ';No DIZRespect Present'
  43.  
  44.     Open('Env','Env:LhA-Control.Paths','W')
  45.     WriteLn('Env',LhA)
  46.     WriteLn('Env',MultiView)
  47.     WriteLn('Env',Rx)
  48.     WriteLn('Env',SwazFix)
  49.     WriteLn('Env',DIZRespect)
  50.     Close('Env')
  51.     Address Command 'C:Copy Env:LhA-Control.Paths EnvArc: Quiet'
  52.     End
  53. Else Do
  54.     LhA = ReadLn('Env')
  55.     MultiView = ReadLn('Env')
  56.     Rx = ReadLn('Env')
  57.     SwazFix = ReadLn('Env')
  58.     DIZRespect = ReadLn('Env')
  59.     Close('Env')
  60.     End
  61. EndIf
  62.  
  63. TmpPath = 'T:LhA-Ctrl_By_Duff/'
  64. OldBuf = BuffersInPref - 1
  65.  
  66.  
  67. TmpList = TmpPath'TmpLhAList.Duff'
  68. TmpFiles = TmpPath'TmpExtFiles.Duff'
  69. ScriptFile = TmpPath'TmpScript.Duff'
  70.  
  71. lf = '0a'x
  72.  
  73. Status 3
  74. ActiveWin = Result
  75.  
  76. Status 13 ActiveWin
  77. CurrentPath = Result
  78.  
  79. If Show('p','MouseActions') = 1 Then Call AllReady
  80.  
  81. Call AddLib("rexxsupport.library",0,-30,0)
  82. Call AddLib("rexxreqtools.library",0,-30,0)
  83.  
  84. If SourceArc ~= '' Then Signal GotIt
  85.  
  86. GetNextSelected
  87. SourceArc = Result
  88. If SourceArc = 0 Then Signal Fuser
  89.  
  90. GotIt:
  91. If Open('TestForLhA',CurrentPath || SourceArc,'R') = 0 Then Signal NotALhAFile
  92. Seek('TestForLhA',2,'B')
  93. If ReadCh('TestForLhA',3) ~= '-lh' Then Signal NotALhAFile
  94. Close('TestForLhA')
  95.  
  96. Ds = 'No Description found in archive....'
  97. Delete('T:File_Id.Diz')
  98. Address Command LhA' x -a -qIM -Qw -Qo -X "' || CurrentPath || SourceArc || '" File_Id.Diz T:'
  99. If DIZRespect ~= "No DizRespect Present" Then Address Command DIZRespect' T:File_Id.Diz T:File_Id.Diz'
  100.  
  101. If Exists('T:File_Id.Diz') = 1 Then
  102.  
  103.     Do
  104.     Open('Desc','T:File_Id.Diz','R')
  105.     Descr = ""
  106.  
  107.         Do While ~EOF('Desc')
  108.         Descr = Descr ReadLn('Desc')
  109.         End
  110.  
  111.     Close('Desc')
  112.     Ds = Right(Descr,Length(Descr)-1)
  113.     Address Command "C:Delete T:File_Id.Diz Quiet"
  114.     End
  115.  
  116. Status 21 ActiveWin set 1
  117. ClearWin
  118. TopText Ds
  119. /* TopText 'Listing 'SourceArc' to buffer...' */
  120.  
  121. Busy On
  122. Address Command 'C:MakeDir "'Left(TmpPath,Length(TmpPath)-1)'"'
  123. Address Command 'C:Assign "Used By Duff:" "'Left(TmpPath,Length(TmpPath)-1)'"'
  124. Address Command LhA' vq -INMXQw "'CurrentPath || SourceArc'" >"'TmpList'"'
  125. Address Command 'C:Sort "'TmpList'" "'TmpList'"'
  126. Open('Archive',TmpList,'R')
  127.  
  128. SetWinTitle '"'SourceArc':"' ActiveWin
  129. AddCustEntry '" -> Double click me when finished <- "' 0 '2' '3' '1' '0' '-1'
  130.  
  131. FindLoop:    Entry = ReadLn('Archive')
  132.         If EOF('Archive') Then Signal FoundAll
  133.         AddCustEntry '"'Entry'"' '?' '-1' '-1' '1' '0' '-1'
  134.         Signal FindLoop
  135. FoundAll:    Close('Archive')
  136.         Delete(TmpList)
  137.         DisplayDir
  138.  
  139.     AddCustHandler 'MouseActions' ActiveWin
  140.     OpenPort('MouseActions')
  141.     Busy Off
  142.  
  143. WaitPacket:
  144.     Call WaitPkt('MouseActions')
  145.     Packet = GetPKT('MouseActions')
  146.  
  147.     Click = GetArg(packet,0)
  148.     Number = GetArg(packet,1)
  149.     Name = GetArg(packet,2)
  150.     User = GetArg(packet,3)
  151.  
  152.     Reply(packet,0)
  153.  
  154.     Busy On
  155.  
  156.     If Click=1 Then
  157.         If Number=0 Then Signal End
  158.         Else Signal DoActionOnFile
  159.  
  160.     If Click=2 Then
  161.         If Number=0 Then Signal SecretPart
  162.         Else Signal AddEntry2File
  163.  
  164.     If Click=q Then Signal End
  165.  
  166.     Busy Off
  167.     Signal WaitForSignal
  168.  
  169. AddEntry2File:    Status 3 set ActiveWin
  170.         SelectEntry Number 1 1
  171.         SelectEntry 0 0 1
  172.  
  173.         Status 3 Set ActiveWin
  174.         GetSelectedAll
  175.         AllFiles = Result
  176.         NumberOfFiles = Words(AllFiles)
  177.  
  178.         Busy On
  179.         Call rtezrequest("There are " || NumberOffiles || " selected file(s)." || lf || lf || "Extract file(s) with full path?", "_Yes|_No|_Extract as...|_Cancel","LhA-Control V2.6","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  180.         Busy Off
  181.         If RTResult = 0 Then Signal WaitForSignal
  182.         Busy On
  183.         If RTResult = 3 Then Signal ExtractAs
  184.  
  185.         TopText 'Building list over file(s) to extract...'
  186.         Open('Selected',TmpFiles,'W')
  187.  
  188.         Do Subject = 1 to NumberOfFiles
  189.         SelectEntry Word(AllFiles,Subject) 0 1
  190.         GetEntry  Word(AllFiles,Subject)+1
  191.         WriteLn('Selected','"'WildCard(Result)'"')
  192.         End Subject
  193.  
  194. Extract:    Close('Selected')
  195.         TopText 'Extracting selected file(s)...'
  196.         Status 13 1-ActiveWin
  197.         Path = Result
  198.         If RTResult = 1 Then
  199.         Address Command LhA' x -aX -qIM -Qw -Qo "'CurrentPath || SourceArc'" "@'TmpFiles'" "'Path'"'
  200.         Else
  201.         Address Command LhA' e -aX -qIM -x2 -Qw -Qo "'CurrentPath || SourceArc'" "@'TmpFiles'" "'Path'"'
  202.         Delete(TmpFiles)
  203.         ReScan 1-ActiveWin
  204.         Busy Off
  205.         Signal WaitForSignal
  206.  
  207. ExtractAs:    TopText "Extracting and renaming file(s)..."
  208.         Busy On
  209.  
  210.         Subject=0
  211. GoLoop:        Busy On
  212.         SelectEntry Word(AllFiles,Subject+1) 0 1
  213.         GetEntry  Word(AllFiles,Subject+1)+1
  214.         Name = Result
  215.         TstName = Substr(Name,LastPos("/",Name)+1)
  216.  
  217.         Status 13 1-ActiveWin
  218.         Path = Result
  219.  
  220.         Call rtgetstring(Name,"(Use '/' in name for dir creation.)" || lf lf || "Enter New File Name:","LhA-Control V2.6","_Extract|_Skip","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  221.         Altered = Result
  222.         If RTResult = 0 Then Signal FuncCanceled
  223.         Busy On
  224.  
  225.         If Exists(Path || Altered) = 1 Then Address Command 'C:Delete "'Path || WildCard(Altered)'" Quiet'
  226.         Call MakeNeededDir Altered
  227.  
  228.         If Exists(Path || TstName) = 0 Then
  229.         Do
  230.         Address Command LhA' e -aX -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'Path'"'
  231.         Address Command 'C:Rename "'Path || WildCard(TstName)'" To "'Path || Altered'"'
  232.         End
  233.             Else
  234.         Do
  235.         Address Command LhA' e -aX -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'TmpPath'"'
  236.         If Altered = WildCard(Altered) Then
  237.         Do
  238.         Address Command 'C:Copy "'TmpPath || WildCard(TstName)'" To "'Path || Altered'"'
  239.         Address Command 'C:Delete "'TmpPath || WildCard(TstName)'" Quiet'
  240.         End
  241.             Else
  242.         Do
  243.         Address Command 'C:Rename "'TmpPath || WildCard(TstName)'" To "'TmpPath'^Findes ik^"'
  244.         Address Command 'C:Copy "'TmpPath'^Findes ik^" To "'Path'^Findes ik^"'
  245.         Address Command 'C:Rename "'Path'^Findes ik^" To "'Path || Altered'"'
  246.         Address Command 'C:Delete "'TmpPath'^Findes ik^"'
  247.         Address Command 'C:Delete "'TmpPath || WildCard(TstName)'"'
  248.         End
  249.         End
  250.  
  251.         ReScan 1-ActiveWin
  252. FuncCanceled:    Subject = Subject +1
  253.         if Subject ~= NumberOfFiles Then Signal GoLoop
  254.         Busy Off
  255.         Signal WaitForSignal
  256.  
  257. MakeNeededDir:    Parse Arg SinglePath
  258.         NewPos = 0
  259. CreatePath:    If Verify(Substr(SinglePath,NewPos+1),'/','Match') = 0 Then Signal Go
  260.         NewPos = Verify(Substr(SinglePath,NewPos+1),'/','Match') + NewPos
  261.         MakeDir(Path || Left(SinglePath,NewPos-1))
  262.         Signal CreatePath
  263. Go:        Return
  264.  
  265. DoActionOnFile:    SelectEntry Number 1 1
  266.         SelectEntry 0 0 1
  267.  
  268.         Status 3 Set ActiveWin
  269.         GetSelectedAll
  270.         AllFiles = Result
  271.         NumberOfFiles = Words(AllFiles)
  272.  
  273.         Busy On
  274.         If Right(Name,5) = '.info' Then Call rtezrequest("There are " || NumberOffiles || " selected file(s)." || lf || lf || "Perform wich kind of action on file(s)?", "_MultiView|_Delete|_Execute...|_IconInfo|_Cancel","LhA-Control V2.6","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  275.         Else Call rtezrequest("There are " || NumberOffiles || " selected file(s)." || lf || lf || "Perform wich kind of action on file(s)?", "_MultiView|_Delete|_Execute...|_Cancel","LhA-Control V2.6","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  276.         Busy Off
  277.         If RTResult = 1 Then Signal MultiView
  278.         If RTResult = 2 Then Signal DeleteFile
  279.         If RTResult = 3 Then Signal Execute
  280.         If RTResult = 4 Then Signal IconInfo
  281.         If RTResult = 0 Then Signal WaitForSignal
  282.  
  283. EndAction:    Signal WaitForSignal
  284.  
  285. MultiView:    TopText "Extracting and MultiView'ing file(s)..."
  286.         Busy On
  287.  
  288.         Subject=1
  289. AIDW:        SelectEntry Word(AllFiles,Subject) 0 1
  290.         GetEntry  Word(AllFiles,Subject)+1
  291.         Name = Result
  292.         TstName = Substr(Name,LastPos("/",Name)+1)
  293.  
  294.         Address Command LhA' e -aX -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'TmpPath'"'
  295.         Address Command MultiView' "'TmpPath || TstName'" Screen'
  296.         Address Command 'C:Delete "'TmpPath || WildCard(TstName)'"'
  297.  
  298.         Subject = Subject + 1
  299.         If Subject ~= NumberOfFiles+1 Then Signal AIDW
  300.  
  301.         DOpusToFront
  302.         Busy Off
  303.         Signal WaitForSignal
  304.  
  305. DeleteFile:    TopText "Deleting selected file(s) in archive..."
  306.         Busy On
  307.  
  308.         Open('Selected',TmpFiles,'W')
  309.         Do Subject = 1 to NumberOfFiles
  310.         SelectEntry Word(AllFiles,Subject)-(Subject-1) 0 1
  311.         GetEntry  Word(AllFiles,Subject)+1-(Subject-1)
  312.         WriteLn('Selected','"'WildCard(Result)'"')
  313.         RemoveEntry Word(AllFiles,Subject)-(Subject-1) 1
  314.         End Subject
  315.  
  316.         Close('Selected')
  317.         Address Command LhA' d -qIM -Qp -Qw -X "'CurrentPath || SourceArc'" "@'TmpFiles'"'
  318.         Delete(TmpFiles)
  319.  
  320.         ClearWin
  321.  
  322.     AddCustHandler 'MouseActions' ActiveWin
  323.     OpenPort('MouseActions')
  324.  
  325.         TopText 'Re-reading 'SourceArc' to buffer...'
  326.         Address Command LhA' vq -INMX -Qw "'CurrentPath || SourceArc'" >"'TmpList'"'
  327.         Address Command 'C:Sort "'TmpList'" "'TmpList'"'
  328.         Open('Archive',TmpList,'R')
  329.         SetWinTitle '"'SourceArc':"' ActiveWin
  330.         AddCustEntry '" -> Double click me when finished <- "' 0 '2' '3' '1' '0' '-1'
  331.  
  332.  
  333. FindLoop2:    Entry = ReadLn('Archive')
  334.         If EOF('Archive') Then Signal FoundAll2
  335.         AddCustEntry '"'Entry'"' '?' '-1' '-1' '1' '0' '-1'
  336.         Signal FindLoop2
  337. FoundAll2:    Close('Archive')
  338.         Delete(TmpList)
  339.         DisplayDir
  340.  
  341.         Busy Off
  342.         Signal WaitForSignal
  343.  
  344. Execute:    TopText "Extracting and executing file(s)..."
  345.         Busy On
  346.  
  347.         Subject=1
  348. FuckLoop:    SelectEntry Word(AllFiles,Subject) 0 1
  349.         GetEntry  Word(AllFiles,Subject)+1
  350.         Name = Result
  351.         TstName = Substr(Name,LastPos("/",Name)+1)
  352.  
  353.         Call rtgetstring(TstName,"Enter Command and its Arguments:","LhA-Control V2.6","_Execute|_Skip","RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  354.         Altered = Result
  355.         If RTResult = 0 Then Signal NameChanged
  356.         Busy On
  357.         Address Command LhA' e -aX -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'TmpPath'"'
  358.  
  359.         If Pos(TstName,Altered) = 0 Then
  360.         WholeFile = Altered
  361.  
  362.         Else
  363.  
  364.         Do
  365.         First = Left(Altered,Pos(TstName,Altered)-1)
  366.         Middle = '"'TmpPath || TstName'"'
  367.         Last = Right(Altered,length(Altered)-(Pos(TstName,Altered)+length(TstName)-1))
  368.         WholeFile = First || Middle || Last
  369.         End
  370.  
  371.         Address Command 'C:List >"'TmpPath'Version1.Duff" "'TmpPath || TstName'" NoHead'
  372.  
  373. Message = Rx' " Address '
  374. Message = Message || "'MouseActions' x"
  375.  
  376.         Open('Script',ScriptFile,'W')
  377.         WriteLn('Script','FailAt 999999')
  378.         WriteLn('Script','Stack 4096')
  379.         WriteLn('Script',WholeFile)
  380.         WriteLn('Script','Echo ""')
  381.         WriteLn('Script','DOpusRT -w -1 "Press left mouse button to continue..."')
  382. /*         WriteLn('Script','Echo NoLine "   Press [RETURN] to continue..."') */
  383. /*         WriteLn('Script','Set >NIL: Return ?') */
  384.         WriteLn('Script',Message)
  385.         WriteLn('Script','EndCLI')
  386.         Close('Script')
  387.  
  388.         Address Command 'C:NewShell "'Shell'" From "'ScriptFile'"'
  389.  
  390.         Call WaitPkt('MouseActions')
  391.         Packet = GetPKT('MouseActions')
  392.         Reply(packet,0)
  393.         Delete(ScriptFile)
  394.  
  395.         Address Command 'C:List >"'TmpPath'Version2.Duff" "'TmpPath || TstName'" NoHead'
  396.  
  397.         Open('OldVer',TmpPath'Version1.Duff','R')
  398.         Open('NewVer',TmpPath'Version2.Duff','R')
  399.         If ReadLn('OldVer') ~= ReadLn('NewVer') Then
  400.         Do
  401.         Call rtezrequest("The file has been changed." || lf || "Would you like to update it?","_Sure!|_Forget it!","LhA-Control V2.6", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  402.         If RTResult = 1 Then Call UpDateFile
  403.         End
  404.         Else Address Command 'C:Delete "'TmpPath || WildCard(TstName)'" NoReq >NIL:'
  405.  
  406.         Close('OldVer')
  407.         Close('NewVer')
  408.  
  409.         Address Command 'C:Delete "'TmpPath || 'Version[1-2].Duff" >NIL:'
  410.  
  411. NameChanged:    Subject = Subject + 1
  412.         If Subject ~= NumberOfFiles+1 Then Signal FuckLoop
  413.  
  414.         DOpusToFront
  415.         Busy Off
  416.         Signal WaitForSignal
  417.  
  418. UpDateFile:    SinglePath = Name
  419.         NewPos = 0 ; First = 0
  420. CreatePath2:    If Verify(Substr(SinglePath,NewPos+1),'/','Match') = 0 Then Signal Go2
  421.         NewPos = Verify(Substr(SinglePath,NewPos+1),'/','Match') + NewPos
  422.         If Left(SinglePath,NewPos-1) = TstName & First = 0 Then
  423.         Do
  424.         First = 1
  425.         Address Command 'C:Rename "'TmpPath || TstName'" "'TmpPath || TstName'.1"'
  426.         TstName = TstName || '.1'
  427.         End        
  428.         MakeDir(TmpPath || Left(SinglePath,NewPos-1))
  429.         Signal CreatePath2
  430. Go2:        Address Command 'C:Rename "' || TmpPath || TstName || '" "' || TmpPath || Name || '"'
  431. ExeUpdate:    Address Command LhA' u -XrqIM -Qw "'CurrentPath || SourceArc'" "'TmpPath'" "'Name'"'
  432.         If RC > 0 Then Signal IOErr
  433. ExeDelete:    If Verify(Name,'/','Match') = 0 Then
  434.         Address Command 'C:Delete "'TmpPath || WildCard(Name)'" All NoReq >NIL:'
  435.         Else
  436.         Do
  437.         NewPos = Verify(Name,'/','Match')
  438.         Address Command 'C:Delete "'TmpPath || WildCard(Left(Name,NewPos))'" All NoReq >NIL:'
  439.         End
  440.         Return
  441.  
  442. IconInfo:    TopText "Extracting and view'ing icon..."
  443.         TstName = Substr(Name,LastPos("/",Name)+1)
  444.  
  445.         Address Command LhA' e -aX -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'TmpPath'"'
  446.         Address Command 'C:List >"'TmpPath'Version1.Duff" "'TmpPath || TstName'" NoHead'
  447.         If Show('p','SWAZINFO') = 0 Then IconInfo '"'TmpPath || TstName'"'
  448.         Else Address Command SwazFix' "'TmpPath || TstName'"'
  449.         EndIf
  450.         Address Command 'C:List >"'TmpPath'Version2.Duff" "'TmpPath || TstName'" NoHead'
  451.         Open('OldVer',TmpPath'Version1.Duff','R')
  452.         Open('NewVer',TmpPath'Version2.Duff','R')
  453.         If ReadLn('OldVer') ~= ReadLn('NewVer') Then
  454.         Do
  455.         Call rtezrequest("The file has been changed." || lf || "Would you like to update it?","_Sure!|_Forget it!","LhA-Control V2.6", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  456.         If RTResult = 1 Then Call UpDateFile
  457.         End
  458.         Else Address Command 'C:Delete "'TmpPath || WildCard(TstName)'" NoReq >NIL:'
  459.         Close('OldVer')
  460.         Close('NewVer')
  461.         Address Command 'C:Delete "'TmpPath || 'Version[1-2].Duff" >NIL:'
  462.         SelectEntry Number 0 1
  463.  
  464.         Signal WaitForSignal
  465.  
  466. WaitForSignal:    TopText "Don't take anything for granted, register TODAY!"
  467.         Signal    WaitPacket
  468.  
  469. IOErr:        Call rtezrequest("Error while updating archive.","_Then try again|_Ohh, fuck that!","LhA-Control V2.6", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  470.         If RTResult = 1 Then Signal ExeUpdate
  471.         Signal ExeDelete
  472.  
  473. Wildcard:    Parse Arg NoWild
  474.         NewPos = 0
  475. SortWild:    If Verify(Substr(NoWild,NewPos+1),'~*#?(|)[%]','Match') = 0 Then Signal FindAtr
  476.         NewPos = Verify(Substr(NoWild,NewPos+1),'~*#?(|)[%]','Match') + NewPos
  477.         NoWild = Insert("'",NoWild,NewPos-1)
  478.         NewPos = NewPos + 1
  479.         Signal SortWild
  480. FindAtr:    If left(NoWild,1) = '@' Then NoWild = Insert('*',NoWild,0)
  481.         Return NoWild
  482.  
  483. End:        Status 21 ActiveWin set OldBuf
  484.         Address Command 'C:Assign "Used By Duff:" Remove'
  485.         Address Command 'C:Delete "'Left(TmpPath,Length(TmpPath)-1)'" All NoReq >NIL:'
  486.         Busy Off
  487.         Exit
  488.  
  489. Fuser:        Call rtezrequest("No file have been selected.","I see","LhA-Control V2.6", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  490.         Busy off
  491.         Exit
  492.  
  493. NotALhAFile:    Call rtezrequest("Sorry, but this doesn't seem to be a LhA file.","hmmrf","LhA-Control V2.6", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  494.         Busy off
  495.         Exit
  496.  
  497. AllReady:    Call rtezrequest("Sorry, but LhA-Control can't be runned twice!" || lf || "Should I quit the other LhA-Ctrl.","_Quit other|_No, commit suicide","LhA-Control V2.6", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  498.         If RTResult = 0 Then Do
  499.         Busy off
  500.         Exit
  501.         End
  502.         Else
  503.         Address 'MouseActions' q
  504. BeSure:        Address Command 'C:Wait 1'
  505.         If Show('p','MouseActions') = 0 Then Return
  506.         Signal BeSure
  507.         Return BackToBase
  508.  
  509. SecretPart:    Busy On
  510.         Call rtezrequest("LhA-Control V2.6 is © 27-Feb-95 by D&D Productions." lf lf "You're welcome to support my work by sending:" lf "Bug reports, own productions, suggestions or gift's!" lf "(Call DreamLine for latest update)" lf lf "Allan 'Duff' Odgaard" lf "Dagmarsgade 36, " lf "DK-2200 Copenhagen," lf "Denmark." lf "EMail: Duff@DK-Online.DK" lf "URL:http://WWW2.DK-Online.DK/Users/Allan_Odgaard/" lf lf "Greetz to Detron, Obiwan, Lowlifes etc.","I'll do that!","Be proud, coz' you found the secret about window!!!","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  511.         Busy Off
  512.         Status 3 set ActiveWin
  513.         SelectEntry 0 0 1
  514.         Signal WaitForSignal
  515.  
  516. Syntax:        Beep
  517.         Status 21 ActiveWin set OldBuf
  518.         Address Command 'C:Assign "Used By Duff:" Remove'
  519.         Address Command 'C:Delete "'Left(TmpPath,Length(TmpPath)-1)'" All NoReq'
  520.         Busy Off
  521.         TopText "Syntax Error" rc"," errortext(rc) "in line" sigl"."
  522.         Busy off
  523.         Exit
  524.